home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / EZY120_1.ZIP / STRUCT.ARJ / CLIB.ARJ / DATE7.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-09  |  597 b   |  28 lines

  1.  
  2. #include <ezylib.h>
  3. #include <dos.h>
  4.  
  5. int CompareDosUnixDate(long PackedDosDate,unsigned long UnixDate)
  6. {
  7.   word Year, Month, Day, Hour, Min, Sec;
  8.   Long2Date(PackedDosDate,Year,Month,Day,Hour,Min,Sec);
  9.   date d;
  10.   time t;
  11.   d.da_year  = Year;
  12.   d.da_mon   = Month;
  13.   d.da_day   = Day;
  14.   t.ti_hour  = Hour;
  15.   t.ti_min   = Min;
  16.   t.ti_sec   = Sec;
  17.   t.ti_hund  = 0;
  18.   unsigned long DosUnixDate = dostounix(&d,&t);
  19.   int RetVal;
  20.   if (DosUnixDate < UnixDate)
  21.     RetVal = -1;
  22.   else if (DosUnixDate == UnixDate)
  23.     RetVal = 0;
  24.   else
  25.     RetVal = 1;
  26.   return(RetVal);
  27. }
  28.